import { artcategoryGet } from '@/api/article'

export default {
  namespaced: true,
  state: {
    artCateList: []
  },
  mutations: {
    setArtCateList (state, artCateList) {
      state.artCateList = artCateList
    }
  },
  actions: {
    async getArtCateList (context) {
      const { data: { code, data = [], message } } = await artcategoryGet()
      if (code !== 0) return console.log('fail')
      console.log(message)
      context.commit('setArtCateList', data)
    }
  },
  getters: {

  }
}
